/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.txt;

import java.util.List;

import lineage.util.collections.Lists;

/**
 * 禁用名字(创建新角色起名时).
 * 
 * @version 2014年3月19日下午2:58:22
 * @author jrwz
 */
public final class L1BanName extends L1AbstractTXT {
    /**
     * 静态初始化器，由JVM来保证线程安全.
     */
    private static class Holder {
        static L1BanName instance = new L1BanName();
    }

    /**
     * 取得该类的实例.
     */
    public static L1BanName getInstance() {
        return Holder.instance;
    }

    private L1BanName() {
        super();
    }

    @Override
    protected String getURL() {
        return "./data/txt/banName.txt";
    }

    @Override
    protected String getMsg() {
        return "加载TXT：禁用名字";
    }

    @Override
    protected List<String> getListAchieve() {
        return Lists.newArrayList();
    }

    /**
     * 检查该名字是否被禁用.
     * 
     * @param name
     *            - 要检查的名字
     * @return 如果被禁用则返回true
     */
    public boolean isBanName(final String name) {
        for (final String str : list) {
            if (name.equalsIgnoreCase(str)) {
                return true;
            }
        }
        return false;
    }
}
